Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support numpy 2 #1317

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Support numpy 2 #1317

wants to merge 1 commit into from

Conversation

jdblischak
Copy link

Closes #1240

Test support for numpy 2

@jdblischak
Copy link
Author

I did some experiments on my fork (had to push to main and update the Linux runner to ubuntu-latest). When I forced numpy==2 in pyproject.toml (otherwise a dependency downgraded numpy to 1.26.4), I got the following errors:

https://github.com/jdblischak/cellxgene-census/actions/runs/11940955066

For Python 3.10 and 3.11 (Linux and macOS), I got pip solver errors. According to pip, the culprit is scikit-learn:

ERROR: Cannot install None, cellxgene-census and cellxgene-census[experimental]==0.1.dev1+gd15e9c6 because these package versions have conflicting dependencies.

The conflict is caused by:
    cellxgene-census 0.1.dev1+gd15e9c6 depends on numpy==2
    cellxgene-census[experimental] 0.1.dev1+gd15e9c6 depends on numpy==2
    datasets 2.0.0 depends on numpy>=1.17
    scikit-learn 1.4.1.post1 depends on numpy<2.0 and >=1.19.5
    cellxgene-census 0.1.dev1+gd15e9c6 depends on numpy==2
    cellxgene-census[experimental] 0.1.dev1+gd15e9c6 depends on numpy==2
    datasets 2.0.0 depends on numpy>=1.17
    scikit-learn 1.4.0 depends on numpy<2.0 and >=1.19.5
    cellxgene-census 0.1.dev1+gd15e9c6 depends on numpy==2
    cellxgene-census[experimental] 0.1.dev1+gd15e9c6 depends on numpy==2
    datasets 2.0.0 depends on numpy>=1.17
    scikit-learn 1.3.2 depends on numpy<2.0 and >=1.17.3
    cellxgene-census 0.1.dev1+gd15e9c6 depends on numpy==2
    cellxgene-census[experimental] 0.1.dev1+gd15e9c6 depends on numpy==2
    datasets 2.0.0 depends on numpy>=1.17
    scikit-learn 1.3.1 depends on numpy<2.0 and >=1.17.3

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip to attempt to solve the dependency conflict

This is a bit puzzling for two reasons. First, when I look at pyproject.toml for scikit-learn 1.4.1.post, there is no upper bound on numpy

https://github.com/scikit-learn/scikit-learn/blob/1.4.1.post1/pyproject.toml#L7

Also, why doesn't pip try to install scikit-learn 1.5 or 1.6? cellxgene-census doesn't have an upper bound on scikit-learn:

For the Linux Python 3.12 build, the source build of scikit-misc 0.3.0 failed:

      ../skmisc/meson.build:22:15: ERROR: Command `/opt/hostedtoolcache/Python/3.12.7/x64/bin/python -c 'import os
      os.chdir(os.path.join("..", "tools"))
      import numpy as np
      try:
        incdir = os.path.relpath(np.get_include())
      except Exception:
        incdir = np.get_include()
      print(incdir)
      '` failed with status 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support numpy 2
1 participant